<template>
	<view>
		<u-navbar :is-back="false" title="　" :border-bottom="false">
			<view class="u-flex u-row-right" style="width: 100%;">
				<view class="camera u-flex u-row-center">
					<u-icon name="camera-fill" color="#000000" size="48"></u-icon>
				</view>
			</view>
		</u-navbar>
		<view class="u-flex user-box u-p-l-30 u-p-r-20 u-p-b-30">
			<view class="u-m-r-10">
				<u-avatar src="pic" size="140"></u-avatar>
			</view>
			<view class="u-flex-1">
				<view class="u-font-18 u-p-b-20">{{params.nickName}}</view>
				<view class="u-font-14 u-tips-color">手机号:{{params.phone}}</view>
			</view>
		</view>

		<view class="u-m-t-20">
			<u-cell-group>
				<u-cell-item icon="rmb-circle" title="积分"></u-cell-item>
			</u-cell-group>
		</view>

		<view class="u-m-t-20">
			<u-cell-group>
				<u-cell-item icon="star" title="报警记录"></u-cell-item>
				<u-cell-item icon="photo" title="事件记录"></u-cell-item>
				<u-cell-item icon="coupon" title="用户手册"></u-cell-item>
			</u-cell-group>
		</view>

		<view class="u-m-t-20">
			<u-cell-group>
				<u-cell-item icon="setting" title="设置"></u-cell-item>
				<u-button type="primary" @click="quit" width="700rpx">退出登录</u-button>
			</u-cell-group>
		</view>
	</view>
</template>

<script>

	export default {
		data() {
			return {
				text: 'uni-app',
				params: {
					phone: '',
					nickName: ''
				}
			}
		},
		onLoad() {
			this.getInfo();

		},
		methods: {

			getInfo: function() {
				this.params = this.$localMap.get('user');
			},
			quit: function() {
				this.$localMap.remove('user');
				this.$localMap.remove('token');
				this.$localMap.remove('login');
				this.$routerTo.page('../login');
			}
		}
	}
</script>

<style lang="scss" scoped>
	page {
		background-color: #ededed;
	}

	.camera {
		width: 54px;
		height: 44px;

		&:active {
			background-color: #ededed;
		}
	}

	.user-box {
		background-color: #fff;
	}
</style>
